<template>
	<view>
		<work-order v-if="isShow" :worktype="workType" :height="swiperHinget"></work-order>
	</view>
</template>

<script>
	import workOrder from "../../../components/work-order/workOrder.vue"
	import util from "../../../utils/util.js"
	export default {
		components:{
			workOrder 
		},
		data() {
			return {
				workType: null,
				swiperHinget: null,
				isShow: true
			};
		},
		onLoad(e) {
			let type = parseInt(e.type)
			let Info = util.getSystemInfo() //获取设备信息
			this.workType = type
			this.setPageTitle(type)
			this.swiperHinget = `height:${Info.windowHeight}px`;
		},
		onUnload() {
			this.isShow = false
		},
		methods:{
			setPageTitle(type){ //动态设置页面标题
				let title = type == 1? '待办事项' : (type == 3? '进行事项' : '完成事项')
				uni.setNavigationBarTitle({
					title: title
				})
			}
		}
	}
</script>

<style>

</style>
